<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div {
            background-color: #ccc;
            height: 40px;
            width: 200px;
            transition: all 0.3s;
            line-height: 40px;
        }

        .ac {
            margin-left: 20px;
            background-color: blueviolet;
            color: #fff;
        }

        body {
            background: url('./images/01.jpg') no-repeat;
            background-size: 100%;
        }
    </style>
</head>

<body>
    <div class="ac" src="./images/01.jpg">btn1</div>
    <div src="./images/02.jpg">btn2</div>
    <div src="./images/03.jpg">btn3</div>
    <div src="./images/04.jpg">btn4</div>
    <div src="./images/05.jpg">btn5</div>
    <script src="./jquery-3.6.0.js"></script>
    <script>
        $('div').click(function () {
            $(this).addClass('ac')
            $(this).siblings().removeClass('ac')
            let a = $(this).attr('src')
            $('body').css("backgroundImage", `url(${a})`)
        })
    </script>
</body>

</html>